package com.lifesting.tool.encoding;

import java.io.Serializable;

public class Setting implements Serializable {
	private static final long serialVersionUID = -6383589309965722363L;
	private String suffix;
	private String currentEncoding;
	private String convertedEncoding;
	private boolean convertCharacter;

	public boolean isConvertCharacter() {
		return this.convertCharacter;
	}

	public void setConvertCharacter(boolean convertCharacter) {
		this.convertCharacter = convertCharacter;
	}

	public Setting() {
	}

	public Setting(String suffix, String currentEncoding, String convertedEncoding, boolean convertCharacter) {
		this.suffix = suffix;
		this.currentEncoding = currentEncoding;
		this.convertedEncoding = convertedEncoding;
		this.convertCharacter = convertCharacter;
	}

	public String getSuffix() {
		return this.suffix;
	}

	public void setSuffix(String suffix) {
		this.suffix = suffix;
	}

	public String getCurrentEncoding() {
		return this.currentEncoding;
	}

	public void setCurrentEncoding(String currentEncoding) {
		this.currentEncoding = currentEncoding;
	}

	public String getConvertedEncoding() {
		return this.convertedEncoding;
	}

	public void setConvertedEncoding(String convertedEncoding) {
		this.convertedEncoding = convertedEncoding;
	}

	public int hashCode() {
		int result = 1;
		result = 31 * result + (this.convertCharacter ? 1231 : 1237);
		result = 31 * result + (this.convertedEncoding == null ? 0 : this.convertedEncoding.hashCode());
		result = 31 * result + (this.currentEncoding == null ? 0 : this.currentEncoding.hashCode());
		result = 31 * result + (this.suffix == null ? 0 : this.suffix.hashCode());
		return result;
	}

	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		Setting other = (Setting) obj;
		if (this.convertCharacter != other.convertCharacter) {
			return false;
		}
		if (this.convertedEncoding == null) {
			if (other.convertedEncoding != null) {
				return false;
			}
		} else if (!this.convertedEncoding.equals(other.convertedEncoding)) {
			return false;
		}
		if (this.currentEncoding == null) {
			if (other.currentEncoding != null) {
				return false;
			}
		} else if (!this.currentEncoding.equals(other.currentEncoding)) {
			return false;
		}
		if (this.suffix == null) {
			if (other.suffix != null) {
				return false;
			}
		} else if (!this.suffix.equals(other.suffix)) {
			return false;
		}
		return true;
	}
}
